package com.game_info.service.impl;

import java.util.List;

import com.game_info.mapper.AdminMapper;
import com.game_info.service.AdminService;
import com.game_info.vo.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-04-14
 */
@Service
public class AdminServiceImpl implements AdminService
{
    @Autowired
    private AdminMapper adminMapper;

    /**
     * 根据id查询单个管理员信息
     *
     * @param aId 管理员id
     * @return
     */
    @Override
    public Admin selectAdminById(Integer aId)
    {
        return adminMapper.selectAdminById(aId);
    }

    /**
     * 查询管理员列表
     *
     * @param admin
     * @return 集合
     */
    @Override
    public List<Admin> selectAdminList(Admin admin)
    {
        return adminMapper.selectAdminList(admin);
    }

    /**
     * 根据ID密码用户名任意组合精准查询管理员信息
     *
     * @param admin
     * @return
     */
    @Override
    public Admin selectAdminByAdmin(Admin admin){
        return adminMapper.selectAdminByAdmin(admin);
    }

    /**
     * 新增
     *
     * @param admin
     * @return 结果
     */
    @Override
    public int insertAdmin(Admin admin)
    {
        return adminMapper.insertAdmin(admin);
    }

    /**
     * 修改管理员信息
     *
     * @param admin
     * @return 结果
     */
    @Override
    public int updateAdmin(Admin admin)
    {
        return adminMapper.updateAdmin(admin);
    }

    /**
     * 批量删除
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAdminByIds(String ids)
    {
        return adminMapper.deleteAdminByIds(ids.split(""));
    }

    /**
     * 删除管理员
     *
     * @param aId
     * @return 结果
     */
    @Override
    public int deleteAdminById(Integer aId)
    {
        return adminMapper.deleteAdminById(aId);
    }
}
